﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Basis.ViewInterface;
using System.Windows;
using Tanmia.Basis.Security;

namespace Tanmia.Basis.Concretes
{
    public class MessageService : IMessageService
    {
        #region IMessageService Members

        public void ShowSecurityMessage(AccessDeniedSecurityException secEx, bool log)
        {
            MessageBox.Show(secEx.ToString(), "Security Violation", MessageBoxButton.OK, MessageBoxImage.Stop);
        }

        public void ShowErrorMessage(Exception ex, bool log)
        {
            MessageBox.Show(ex.ToString(), "Error Message", MessageBoxButton.OK, MessageBoxImage.Stop);
        }

        public void ShowExclamationMessage(Exception ex, string caption, bool log)
        {
            MessageBox.Show(ex.Message, caption, MessageBoxButton.OK, MessageBoxImage.Exclamation);
        }

        public MessageServiceResultEnum RequestUserConfirmation(string requestMessage, string caption = "")
        {
            MessageBoxResult msgBoxResult = MessageBox.Show(requestMessage, caption, MessageBoxButton.YesNo, MessageBoxImage.Question);
            return (MessageServiceResultEnum)msgBoxResult;
        }

        #endregion
    }
}
